import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class SearchScreen extends StatefulWidget {
  const SearchScreen({Key? key}) : super(key: key);

  @override
  State<SearchScreen> createState() => _SearchScreenState();
}

class _SearchScreenState extends State<SearchScreen> {

  String _keywords = "";

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: IconButton(
          onPressed: () {Navigator.pop(context);},
        icon: Icon(Icons.arrow_back_ios,color: Colors.black87,size: 40.w,)
    ),
        elevation: 0,
        backgroundColor: const Color.fromARGB(255, 230, 230, 230),
        title: Container(
          decoration: BoxDecoration(
            color: Colors.white70,
            borderRadius: BorderRadius.circular(5.w),
          ),
          height: 65.h,
          child: TextField(
            cursorColor: Colors.black87,
            onChanged: (value) {
              _keywords = value;
            },
            decoration: InputDecoration(

              border: OutlineInputBorder(
                borderRadius: BorderRadius.circular(5.w),
                borderSide: BorderSide.none
                )
            ),
          ),
        ),
        actions: [
          GestureDetector(
            onTap: () {
              Navigator.pushNamed(context, "/itemInfo",arguments: {
                "categoryName": "搜索结果",
                "keywords": _keywords
              });
            },
            child: Container(
                width: 80.w,
                height: 56.h,
                child: Row(children: const [
                  Text("搜索",style: TextStyle(color: Colors.black87),)
                ],)
            ),
          )
        ],
      ),
      body: Container(),
    );
  }
}
